package com.easy.framework.security.enums;

import com.easy.framework.common.enums.CommonStatus;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

@Getter
@RequiredArgsConstructor
public enum DataScopeEnum {
    ALL("ALL","全部数据权限"),
    DEPT("DEPT","部门数据权限"),
    DEPT_CHILD("DEPT_CHILD","部门及以下数据权限"),
    SELF("SELF","本人数据权限"),
    CUSTOM("CUSTOM","自定义数据权限");

    /**
     * 值
     */
    private final String value;

    /**
     * 名称
     */
    private final String name;

    public static String getName(String value) {
        for (DataScopeEnum item : DataScopeEnum.values()) {
            if (item.getValue().equals(value)) {
                return item.getName();
            }
        }
        return "";
    }
}
